'
' Copyright (c) 2004-2005
' by Peter Donker ( info@bring2mind.net )
'
' Permission is hereby granted to use and/or modify this software for a single server. It is 
' NOT permitted to publish, distribute, sublicense, and/or sell copies of this software in its
' original or modified form. You are not allowed to remove this copyright notice.
'
' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 
' BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
' NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 
' DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
' OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OF THE SOFTWARE.
'
Imports System
Imports DotNetNuke

Namespace Bring2mind.DNN.Modules.Guestbook.Data

 Public MustInherit Class DataProvider

#Region "Shared/Static Methods"

  ' singleton reference to the instantiated object 
  Private Shared objProvider As DataProvider = Nothing

  ' constructor
  Shared Sub New()
   CreateProvider()
  End Sub

  ' dynamically create provider
  Private Shared Sub CreateProvider()
   objProvider = CType(Framework.Reflection.CreateObject("data", "Bring2mind.DNN.Modules.Guestbook.Data", "Bring2mind.DNN.Modules.Guestbook"), DataProvider)
  End Sub

  ' return the provider
  Public Shared Shadows Function Instance() As DataProvider
   Return objProvider
  End Function

#End Region

#Region "Entries Methods"

	Public MustOverride Function GetEntries(ByVal EntryId As Integer, ByVal ModuleId as Integer) As IDataReader
	
	Public MustOverride Function AddEntries(ByVal Body As String, ByVal DateSubmitted As Date, ByVal Email As String, ByVal IsApproved As Boolean, ByVal ModuleId As Integer, ByVal Picture As String, ByVal UserName As String) As Integer
	
	Public MustOverride Sub UpdateEntries(ByVal EntryId As Integer, ByVal Body As String, ByVal DateSubmitted As Date, ByVal Email As String, ByVal IsApproved As Boolean, ByVal ModuleId As Integer, ByVal Picture As String, ByVal UserName As String)
	
	Public MustOverride Sub DeleteEntries(ByVal EntryId As Integer)
	
Public MustOverride Function GetEntriesByModules(ByVal moduleID As Integer , IncludeNonApproved As Boolean) As IDataReader

#End Region

#Region "Other Procedures"
#End Region

 End Class

End Namespace

